# -*- coding: utf-8 -*-

from ctypes import *

checsumDll=CDLL('mavlinkChecksum.dll')
# a example of message without packet start sign
msgStream='282E0101B801294601FF674714998EC7434A6101008CFDFFFF40AFB33F5834413EFCFF1200000050461B000000'.decode('hex')
#FE282E0101B801294601FF674714998EC7434A6101008CFDFFFF40AFB33F5834413EFCFF1200000050461B00000068DF
length = c_uint16(len(msgStream))
string = c_char_p(msgStream)
crc_calc = checsumDll.pub_crc_calculate_final
# crc_calc = checsumDll.pub_crc_calculate
crc_calc.restype= c_uint16
result =crc_calc(string,length)
# print string
# print result
# print hex(result) 
